﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;

using SolutionOrchestrator.Validators;

namespace SolutionOrchestrator
{
	class FixTemplateSelector : DataTemplateSelector
	{
		public override DataTemplate SelectTemplate(object item, DependencyObject container)
		{
			var fixable = item as FixableViolation;
			if (fixable != null && fixable.FixesCount > 0)
			{
				return (DataTemplate)Application.Current.MainWindow.Resources["fixTemplate"];
			}
			return (DataTemplate)Application.Current.MainWindow.Resources["emptyTemplate"];
		}
	}
}
